
from QCmdInputPipe import QCmdInputPipe
from QServerModePipe import QServerModePipe
from QClientModePipe import QClientModePipe
from EventDefine import event_CMDPIPE_SYNCOK, event_CMDPIPE_SYNCFAIL

cmdPipeMap = {
    "single":QCmdInputPipe,
    "server":QServerModePipe,
    "client":QClientModePipe,
}

# Singleton
CommandPipe = None
def CommandPipeReset(cmdPipeType, **kw):
    global CommandPipe
    CommandPipe = cmdPipeMap[cmdPipeType](**kw)
    return CommandPipe

def CommandPipeGet():
    global CommandPipe
    return CommandPipe